home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 27
/
Mac Magazin and MacEasy Magazine CD - Issue 27.iso
/
System
/
Kontrollfelder
/
WDEFLeopard_1_2_1
/
Read Me
next >
Wrap
Text File
|
1996-10-18
|
3KB
|
87 lines
WDEF Leopard 1.2.1
by Maf Vosburgh
18th of October 1996
Price Info
WDEF Leopard is free.
Share and enjoy.
Contact Info
maf@mmcorp.com
http://www.mmcorp.com/~maf
Legal Info
This software is supplied "As Is" without warranty of any kind, and the
author does not accept responsibility for any damage it might
accidentally cause.
Info for Normal People
There has been a lot of panic recently about the "WDEF crash" : system
error 87.
To prevent this and other related crashes (84, 88 & 89) I wrote this control
panel.
Just drag it to your Control Panels folder and restart.
It installs a friendly "WDEF Leopard" who will try to guard your system
from harm with her powerful paws.
Info for Geeks
As it turns out, WDEF resources shouldn't be purgeable.
This is documented, but barely (as pointed out by Robert Thornton).
Here is why they should not be purgeable- if the custom WDEF for a
window gets purged, and the Window Manager tries to redraw that window
while the app is in the background, it fails to reload the WDEF code,
because it calls LoadResource with the wrong current resource file.
The Window Manager engineers could fix this by -
a) inserting one line of code (a call to HNoPurge) in their code that
loads custom WDEFs,
or
b) inserting a few lines of code around their call to LoadResource so
they use the right resource file
or
c) at least publicise the fact that WDEFs should not be purgeable.
In the meantime, this INIT aims to fix the problem by briefly taking
control whenever an application is launched and marking the resources in
question non-purgeable. It does not save these changes to disk, so it
shouldn't cause problems with updaters, virus checkers, backup programs
etc.
As long as the app doesn't explicitly do an HPurge on the these Handles,
everything should be fine.
The initial version just scanned for WDEFs. This version takes things a
step further can also load MDEFs, MENUs and CDEFs.
Revision History
Version 1.0
First release.
Version 1.1
I added MDEF, CDEF and MENU resources to the list of types to preload
and make unpurgeable.
This has improved the robustness of certain programs considerably when
put to the standard test - switch to ZoneRanger, purge the heap of the
target app, then make it redraw while in the background.
Version 1.2
Made it into a Control Panel, so users can choose which resources are
preloaded.
Removed the option to preload MENUs, as this crashes ClarisWorks 4.0.
Version 1.2.1
In line with various suggestions made by Robert Thornton, I changed the
strategy of the code - it now no longer preloads resources, just marks
them non-purgeable in the resource map. This is faster, uses less
memory, and also fixes the previous MENU conflict with ClarisWorks. That
has enabled me to reinstate the MENU protection feature (which protects
you from system error 84). The patch on _InitGraf is now a proper
head-patch (don't worry if you don't know what that means).
Thanks to
Robert Thornton for key information.
Graham Bartram for the name.
Dan Salmon for being the first tester.
Binky and Kevin for being cool.
Vik Rubenfeld for pointing the problem out on Usenet.
Tracy Valleu, Troy Gaul, Robert Thornton and Ric Ford for other info.